package com.sicheng.蓝桥.省赛.第九届;

import java.util.Scanner;

/**
 * @author zsc
 * @version 1.0
 * @date 2022/1/23 20:05
 * https://wmathor.com/index.php/archives/1293/
 */
public class 螺旋折线 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long x = scanner.nextInt();
        long y = scanner.nextInt();
        // 点(x,y)在第n层
        long n = Math.max(Math.abs(x), Math.abs(y));
        long sum0 = 4 * n * (n - 1) + 1;
        // 第i层从 (-i,-i+1)开始逆时针螺旋
        long sum = 0;
        if (x == -n && -n + 1 <= y && y <= n)
            sum += y + n - 1;

        else if (y == n && x > -n && x <= n)
            sum += 2 * n - 1 + x + n;

        else if (x == n && y < n && y >= -n)
            sum += 5 * n - 1 - y;
        else
            sum += 7 * n - x - 1;

        sum += sum0;
        System.out.println(sum);

    }
}
